<?php

/**
 * Log form base class.
 *
 * @method Log getObject() Returns the current form's model object
 *
 * @package    sop
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseLogForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'dt_modif'      => new sfWidgetFormDateTime(),
      'guard_id'      => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => false)),
      'user_id'       => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => false)),
      'date'          => new sfWidgetFormDate(),
      'heure_arrivee' => new sfWidgetFormDateTime(),
      'heure_depart'  => new sfWidgetFormDateTime(),
      'temps_pause'   => new sfWidgetFormInputText(),
      'total_journee' => new sfWidgetFormInputText(),
      'type_id'       => new sfWidgetFormPropelChoice(array('model' => 'TypeJour', 'add_empty' => false)),
      'id'            => new sfWidgetFormInputHidden(),
    ));

    $this->setValidators(array(
      'dt_modif'      => new sfValidatorDateTime(),
      'guard_id'      => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
      'user_id'       => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
      'date'          => new sfValidatorDate(),
      'heure_arrivee' => new sfValidatorDateTime(),
      'heure_depart'  => new sfValidatorDateTime(),
      'temps_pause'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'total_journee' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'type_id'       => new sfValidatorPropelChoice(array('model' => 'TypeJour', 'column' => 'id')),
      'id'            => new sfValidatorChoice(array('choices' => array($this->getObject()->getId()), 'empty_value' => $this->getObject()->getId(), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('log[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Log';
  }


}
